var GuVo = {
	getNowPrice: function(code, callBack) {
		getNowVal(code).then(res => {
		
			callBack(getNowVo(code,res));
		})
	},
	getNowVo:function(code,res){
		let row = res.data[code].qt[code];
		let item = {};
		item.name = row[1]; //名字
		item.nowPrice = row[3]; //现价
		item.yesterdayPrice = row[4]; //昨收
		item.openPrice = row[5]; //开盘价
		item.maxPrice = row[33]; //最高价
		item.minPrice = row[34]; //最低价
		item.persent = (row[3] - row[4]) / row[3]; //涨跌幅
		item.persent = item.persent > 0 ? "+" + (item.persent * 100).toFixed(2) : (item.persent * 100).toFixed(2);
		item.persent = item.persent + "%";
		item.dealPower = row[6]; //213703
		item.list = row;
		return item;
	},
	getNowP:function(code){
		return getNowVal(code);
	},
	getLastDately: function(code, callBack) {
		//最近日k
		getDately(code, (res) => {
			var arr = res.split("\n");;
			arr.pop();
			arr.shift();
			arr.shift();

			arr = arr.map(row => {
				return row.split(" ");
			})
			//[时间，开盘价，收盘价，最高价，最低价，成交量]
			callBack(arr);
		});

	},
	getYearDately: function(code, year, callBack) {
		//每年日K
		getYearDately(code, year, (res => {
			var arr = res.split("\n");
			arr.pop();
			arr.shift();
			arr = arr.map(row => {
				return row.split(" ");
			})
			//[时间，开盘价，收盘价，最高价，最低价，成交量]
			callBack(arr);
		}));
	},
	getLastMonth:function(code,callBack){
		////最近月K
		getLastMonth(code,res=>{
			 var arr = res.split("\n");
			 arr.pop();
			 arr.shift();
			 arr = arr.map(row => {
			 	return row.split(" ");
			 })
			 //[时间，开盘价，收盘价，最高价，最低价，成交量]
			 callBack(arr);
		});
	}
}
